/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package clientside;

import client.gui.MainView;
import java.io.*;
import java.net.*;
import client.network.*;
import com.cse.p2p.common.CommonSettings;
import java.awt.Toolkit;
import javax.swing.JFrame;
import javax.swing.UIManager;

/**
 *
 * @author TrungHieu
 */
public class ClientSide {

	public static String IPServer = "";
	public static int portServer = CommonSettings.SERVER_SERVERSOCKET;

	public static void main( String[] args ) {
		ControlClientSide controlThread  = new ControlClientSide();
		DataClientSide dataThead = new DataClientSide();
		controlThread.start();
		dataThead.start();
		new ClientControlTask_Client( IPServer, portServer ).start();
		try {
			UIManager.setLookAndFeel( "com.seaglasslookandfeel.SeaGlassLookAndFeel" );
//			UIManager.setLookAndFeel( "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel" );
			Toolkit tk = Toolkit.getDefaultToolkit();
			MainView mainview = new MainView(controlThread, dataThead);
			mainview.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
			mainview.setSize( tk.getScreenSize().width - 10, tk.getScreenSize().height - 50 );
			mainview.setLocationRelativeTo( null );
			mainview.setVisible( true );
		}
		catch ( Exception e ) {
			e.printStackTrace();
		}
	}
}